type User = {
	id: number,
	kind: string
}

type ReturnMate<T extends User, U> = {
	[K in keyof U as K extends keyof T ? K : never]: U[K]
}

/*
* 使用 ReturnMake 工具类型
* */
function makeCustomer<T extends User> (u:T):ReturnMate<T, User> {
	return {
		id: u.id,
		kind: 'customer'
	}
}
